package cn.kgc.service.impl;

import cn.kgc.dao.UserDao;
import cn.kgc.dao.impl.UserDaoImpl;
import cn.kgc.entity.User;
import cn.kgc.service.UserService;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/6/27
 * @description
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();


    @Override
    public List<User> userList() {
        return userDao.userList("a.selectAll");
    }

    @Override
    public User selectOne(Integer id) {
        User user = userDao.selectOne("a.selectOne", id);
        return user;
    }

    @Override
    public Integer addUser(User user) {

        return userDao.addUser("a.addUser",user);
    }

    @Override
    public Integer updateUser(User user) {

        return userDao.updateUser("a.updateUser",user);
    }

    @Override
    public Integer deleteUser(Integer id) {

        return userDao.deleteUser("a.deleteById",id);
    }
}
